<script setup>
/**
 * name：
 * user：sa0ChunLuyu
 * date：2022-05-24 11:23:13
 */
import {useStore, useRouterActive} from '~/store'
const $store = useStore()
const $router_active = useRouterActive()
const breadcrumb_list = computed(() => {
  let list = []
  for (let i in $router_active.value) {
    if ($router_active.value[i].key !== 'index') {
      list.push($router_active.value[i])
    }
  }
  return list
})
</script>
<template>
  <n-breadcrumb ml-5>
    <n-breadcrumb-item v-if="breadcrumb_list.length !== 0" href="#">
      <n-icon mr-2>
        <div i-ic-round-home class="breadcrumb_icon_wrapper"></div>
      </n-icon>
      <span>{{ $store.config.title }}</span>
    </n-breadcrumb-item>
    <n-breadcrumb-item v-for="(bi,bk) in breadcrumb_list" :key="bk" :disabled="bk !== breadcrumb_list.length - 1">
      <n-icon v-if="bi.icon" mr-2>
        <div :class="[bi.icon]"></div>
      </n-icon>
      <span>{{ bi.title }}</span>
    </n-breadcrumb-item>
  </n-breadcrumb>
</template>
